package com.example.demo.service.impl;

import com.example.demo.mapper.ScoreMapper;
import com.example.demo.pojo.Score;
import com.example.demo.service.ScoreService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import java.util.List;


@Service
public class ScoreServiceImpl implements ScoreService {

    @Resource
    private ScoreMapper scoreMapper;

    @Override
    public void addScore(Score score) {
        scoreMapper.addScore(score);
    }

    @Override
    public void deleteScore(Integer studentId) {
        scoreMapper.deleteById(studentId);
    }

    @Override
    public void updateScore(Score score) {
        scoreMapper.update(score);
    }

    @Override
    public List<Score> getAllScores() {
        return scoreMapper.selectAll();
    }

    @Override
    public Score getScoreById(Integer studentId) {
        return scoreMapper.selectById(studentId);
    }
}